<template>
  <div class="modal-overlay" @click="close">
    <div class="modal-content" @click.stop>
      <div class="modal-header">
        <h3>创建索引</h3>
        <button class="modal-close" @click="close">×</button>
      </div>
      <div class="modal-body">
        <CreateIndex 
          :is-connected="isConnected"
          @index-created="handleIndexCreated"
          @close-modal="close"
        />
      </div>
    </div>
  </div>
</template>

<script>
import CreateIndex from '../CreateIndex.vue';

export default {
  name: 'CreateIndexModal',
  components: {
    CreateIndex
  },
  props: {
    isConnected: {
      type: Boolean,
      required: true
    }
  },
  methods: {
    close() {
      this.$emit('close');
    },
    handleIndexCreated() {
      this.$emit('index-created');
    }
  }
}
</script>